package com.demo.spring.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.stereotype.Component;

@Component
public class MyBeanFactoryAware implements BeanFactoryAware {

    private BeanFactory beanFactory;

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    	System.out.println("set beanFactory: " + beanFactory);
        this.beanFactory = beanFactory;
    }

	public BeanFactory getBeanFactory() {
		return beanFactory;
	}

}